<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: MultiPart.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">MultiPart.h</div></div>
</div><!--header-->
<div class="contents">
<a href="MultiPart_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;drogon/utils/Utilities.h&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &lt;<a class="code" href="exports_8h.html">drogon/exports.h</a>&gt;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &lt;<a class="code" href="HttpRequest_8h.html">drogon/HttpRequest.h</a>&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &lt;string_view&gt;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacedrogon.html">drogon</a></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>{</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="keyword">class </span>HttpFileImpl;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="};">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html">   34</a></span><span class="keyword">class </span><a class="code hl_define" href="exports_8h.html#a00d0a001c2dd03906272e00b0598182e">DROGON_EXPORT</a> <a class="code hl_class" href="classdrogon_1_1HttpFile.html">HttpFile</a></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>{</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>  <span class="keyword">public</span>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#ad63852f264c84aad514e36c7440d1e8b">   37</a></span>    <span class="keyword">explicit</span> <a class="code hl_function" href="classdrogon_1_1HttpFile.html#ad63852f264c84aad514e36c7440d1e8b">HttpFile</a>(std::shared_ptr&lt;HttpFileImpl&gt; &amp;&amp;implPtr) <span class="keyword">noexcept</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a1a8156991a41ae7af14791f853e3ee34">   39</a></span>    <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1HttpFile.html#a1a8156991a41ae7af14791f853e3ee34">getFileName</a>() const noexcept;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#ac70a5a88a54fe1d6e8c54cf3aefafee8">   44</a></span>    std::string_view getFileExtension() const noexcept;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a3952116dcf127fe2c833770829624226">   47</a></span>    const std::<span class="keywordtype">string</span> &amp;getItemName() const noexcept;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a5adb3a36157ccf4010c397be742de5ca">   50</a></span>    <a class="code hl_enumeration" href="namespacedrogon.html#a968450214a7b7493f6f9eda71082e784">FileType</a> getFileType() const noexcept;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a7718a356dc1d982125ab7911c41755dc">   53</a></span>    <span class="keywordtype">void</span> setFileName(const std::<span class="keywordtype">string</span> &amp;fileName) noexcept;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a5498fc58c973ce468fe42046d9a9995b">   57</a></span>    <span class="keywordtype">void</span> setFile(const <span class="keywordtype">char</span> *data, <span class="keywordtype">size_t</span> length) noexcept;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a4c70212d5f8d577ebb938cfd01ff80bc">   64</a></span>    <span class="keywordtype">int</span> save() const noexcept;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a1f70e157df386260c1af0baf0b1401ef">   73</a></span>    <span class="keywordtype">int</span> save(const std::<span class="keywordtype">string</span> &amp;path) const noexcept;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a9e10088b900a4d1c70af9efd0dcebb1f">   81</a></span>    <span class="keywordtype">int</span> saveAs(const std::<span class="keywordtype">string</span> &amp;fileName) const noexcept;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a2754542c9946865f414b52f902eb0df0">   88</a></span>    std::string_view fileContent() const noexcept</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        <span class="keywordflow">return</span> std::string_view{fileData(), fileLength()};</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>    }</div>
</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a7112e33c467820beb4b85c4ae3cf82bd">   94</a></span>    <span class="keywordtype">size_t</span> <a class="code hl_function" href="classdrogon_1_1HttpFile.html#a7112e33c467820beb4b85c4ae3cf82bd">fileLength</a>() const noexcept;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a998ba16beb70bb3037a5f3a9c2938394">   97</a></span>    <a class="code hl_namespace" href="namespacedrogon.html">drogon</a>::<a class="code hl_enumeration" href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">ContentType</a> getContentType() const noexcept;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#a1c01ad896141e1eb07d202464983e223">  108</a></span>    const <span class="keywordtype">char</span> *fileData() const noexcept;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#aff73bb0a1bd74c6b150f3b62c4a5119e">  111</a></span>    std::<span class="keywordtype">string</span> getMd5() const noexcept;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="classdrogon_1_1HttpFile.html#accc3cf438b66fba359f2d98f1931cf7f">  114</a></span>    const std::<span class="keywordtype">string</span> &amp;getContentTransferEncoding() const noexcept;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>  private:</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>    std::shared_ptr&lt;HttpFileImpl&gt; implPtr_;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>};</div>
</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="foldopen" id="foldopen00122" data-start="{" data-end="};">
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html">  122</a></span>class <a class="code hl_define" href="exports_8h.html#a00d0a001c2dd03906272e00b0598182e">DROGON_EXPORT</a> <a class="code hl_class" href="classdrogon_1_1MultiPartParser.html">MultiPartParser</a></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>{</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>  <span class="keyword">public</span>:</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#aa1cd21a9005e0581c75da6c1b9d4f82e">  125</a></span>    <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#aa1cd21a9005e0581c75da6c1b9d4f82e">MultiPartParser</a>(){};</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a7fa714486589d624cb5be2af8a01bbf3">  126</a></span>    <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#a7fa714486589d624cb5be2af8a01bbf3">MultiPartParser</a>(<span class="keyword">const</span> <a class="code hl_class" href="classdrogon_1_1MultiPartParser.html">MultiPartParser</a> &amp;other) = <span class="keywordflow">default</span>;  <span class="comment">// Copyable</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#ae1386f734b22c97504319f34eab7ba20">  127</a></span>    <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#ae1386f734b22c97504319f34eab7ba20">MultiPartParser</a>(<a class="code hl_class" href="classdrogon_1_1MultiPartParser.html">MultiPartParser</a> &amp;&amp;other) = <span class="keywordflow">default</span>;       <span class="comment">// Movable</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#aaf3379409a74fcc19d5efa9a012e70ee">  128</a></span>    <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#aaf3379409a74fcc19d5efa9a012e70ee">~MultiPartParser</a>(){};</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a94738ba45d6149eef0af2923f62c82a1">  131</a></span>    <span class="keyword">const</span> std::vector&lt;HttpFile&gt; &amp;<a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#a94738ba45d6149eef0af2923f62c82a1">getFiles</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#adf60955fac0b2816fc04d9c414fc473d">  134</a></span>    std::unordered_map&lt;std::string, HttpFile&gt; <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#adf60955fac0b2816fc04d9c414fc473d">getFilesMap</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#ab711507f4a50f4b5092a6820d51d6c76">  138</a></span>    <span class="keyword">const</span> SafeStringMap&lt;std::string&gt; &amp;<a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#ab711507f4a50f4b5092a6820d51d6c76">getParameters</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00143" data-start="{" data-end="}">
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#ad7a2ea2850e1b43b92cfed2fc0ec0844">  143</a></span>    std::optional&lt;T&gt; <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#ad7a2ea2850e1b43b92cfed2fc0ec0844">getOptionalParameter</a>(<span class="keyword">const</span> std::string &amp;key)</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>    {</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>        <span class="keyword">auto</span> &amp;params = getParameters();</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>        <span class="keyword">auto</span> it = params.find(key);</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>        <span class="keywordflow">if</span> (it != params.end())</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>        {</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>            <span class="keywordflow">try</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>            {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>                <span class="keywordflow">return</span> std::optional&lt;T&gt;(utils::fromString&lt;T&gt;(it-&gt;second));</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>            }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>            <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception &amp;e)</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>            {</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>                LOG_ERROR &lt;&lt; e.what();</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>                <span class="keywordflow">return</span> std::optional&lt;T&gt;{};</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>            }</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>        }</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>        {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>            <span class="keywordflow">return</span> std::optional&lt;T&gt;{};</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>        }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>    }</div>
</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00169" data-start="{" data-end="}">
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a9171c2e41ae541ae415fa11fca1bc3e5">  169</a></span>    T <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#a9171c2e41ae541ae415fa11fca1bc3e5">getParameter</a>(<span class="keyword">const</span> std::string &amp;key)</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>    {</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>        <span class="keywordflow">return</span> getOptionalParameter&lt;T&gt;(key).value_or(T{});</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>    }</div>
</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#ab2fec74184787d58dd0c359ecfbf63d8">  175</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#ab2fec74184787d58dd0c359ecfbf63d8">parse</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>  <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a0a08a0997920f3d1f00f4f17ce6318d3">  178</a></span>    std::vector&lt;HttpFile&gt; <a class="code hl_variable" href="classdrogon_1_1MultiPartParser.html#a0a08a0997920f3d1f00f4f17ce6318d3">files_</a>;</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a0d3b352b9545ae2917a567a8d335fbe8">  179</a></span>    SafeStringMap&lt;std::string&gt; <a class="code hl_variable" href="classdrogon_1_1MultiPartParser.html#a0d3b352b9545ae2917a567a8d335fbe8">parameters_</a>;</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#a1595699fa16f58b93976e92865fdee73">  180</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#a1595699fa16f58b93976e92865fdee73">parse</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req,</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>              <span class="keyword">const</span> <span class="keywordtype">char</span> *boundaryData,</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>              <span class="keywordtype">size_t</span> boundaryLen);</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="classdrogon_1_1MultiPartParser.html#aab6c3ed6b8fc8d24f2bfc42096b871e4">  183</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="classdrogon_1_1MultiPartParser.html#aab6c3ed6b8fc8d24f2bfc42096b871e4">parseEntity</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacedrogon.html#a5200699555f98a809538342baa167aad">HttpRequestPtr</a> &amp;req,</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *begin,</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *end);</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>};</div>
</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"><a class="line" href="namespacedrogon.html#a17d03bfb324270c6392cecd443b8d352">  189</a></span><span class="keyword">using </span><a class="code hl_class" href="classdrogon_1_1MultiPartParser.html">FileUpload</a> = <a class="code hl_class" href="classdrogon_1_1MultiPartParser.html">MultiPartParser</a>;</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span> </div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>}  <span class="comment">// namespace drogon</span></div>
<div class="ttc" id="aHttpRequest_8h_html"><div class="ttname"><a href="HttpRequest_8h.html">HttpRequest.h</a></div></div>
<div class="ttc" id="aclassdrogon_1_1HttpFile_html"><div class="ttname"><a href="classdrogon_1_1HttpFile.html">drogon::HttpFile</a></div><div class="ttdoc">This class represents a uploaded file by a HTTP request.</div><div class="ttdef"><b>Definition</b> MultiPart.h:35</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpFile_html_a1a8156991a41ae7af14791f853e3ee34"><div class="ttname"><a href="classdrogon_1_1HttpFile.html#a1a8156991a41ae7af14791f853e3ee34">drogon::HttpFile::getFileName</a></div><div class="ttdeci">const std::string &amp; getFileName() const noexcept</div><div class="ttdoc">Return the file name;</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpFile_html_a7112e33c467820beb4b85c4ae3cf82bd"><div class="ttname"><a href="classdrogon_1_1HttpFile.html#a7112e33c467820beb4b85c4ae3cf82bd">drogon::HttpFile::fileLength</a></div><div class="ttdeci">size_t fileLength() const noexcept</div><div class="ttdoc">Return the file length.</div></div>
<div class="ttc" id="aclassdrogon_1_1HttpFile_html_ad63852f264c84aad514e36c7440d1e8b"><div class="ttname"><a href="classdrogon_1_1HttpFile.html#ad63852f264c84aad514e36c7440d1e8b">drogon::HttpFile::HttpFile</a></div><div class="ttdeci">HttpFile(std::shared_ptr&lt; HttpFileImpl &gt; &amp;&amp;implPtr) noexcept</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html">drogon::MultiPartParser</a></div><div class="ttdef"><b>Definition</b> MultiPart.h:123</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a0a08a0997920f3d1f00f4f17ce6318d3"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a0a08a0997920f3d1f00f4f17ce6318d3">drogon::MultiPartParser::files_</a></div><div class="ttdeci">std::vector&lt; HttpFile &gt; files_</div><div class="ttdef"><b>Definition</b> MultiPart.h:178</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a0d3b352b9545ae2917a567a8d335fbe8"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a0d3b352b9545ae2917a567a8d335fbe8">drogon::MultiPartParser::parameters_</a></div><div class="ttdeci">SafeStringMap&lt; std::string &gt; parameters_</div><div class="ttdef"><b>Definition</b> MultiPart.h:179</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a1595699fa16f58b93976e92865fdee73"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a1595699fa16f58b93976e92865fdee73">drogon::MultiPartParser::parse</a></div><div class="ttdeci">int parse(const HttpRequestPtr &amp;req, const char *boundaryData, size_t boundaryLen)</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a7fa714486589d624cb5be2af8a01bbf3"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a7fa714486589d624cb5be2af8a01bbf3">drogon::MultiPartParser::MultiPartParser</a></div><div class="ttdeci">MultiPartParser(const MultiPartParser &amp;other)=default</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a9171c2e41ae541ae415fa11fca1bc3e5"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a9171c2e41ae541ae415fa11fca1bc3e5">drogon::MultiPartParser::getParameter</a></div><div class="ttdeci">T getParameter(const std::string &amp;key)</div><div class="ttdef"><b>Definition</b> MultiPart.h:169</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_a94738ba45d6149eef0af2923f62c82a1"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#a94738ba45d6149eef0af2923f62c82a1">drogon::MultiPartParser::getFiles</a></div><div class="ttdeci">const std::vector&lt; HttpFile &gt; &amp; getFiles() const</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_aa1cd21a9005e0581c75da6c1b9d4f82e"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#aa1cd21a9005e0581c75da6c1b9d4f82e">drogon::MultiPartParser::MultiPartParser</a></div><div class="ttdeci">MultiPartParser()</div><div class="ttdef"><b>Definition</b> MultiPart.h:125</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_aab6c3ed6b8fc8d24f2bfc42096b871e4"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#aab6c3ed6b8fc8d24f2bfc42096b871e4">drogon::MultiPartParser::parseEntity</a></div><div class="ttdeci">int parseEntity(const HttpRequestPtr &amp;req, const char *begin, const char *end)</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_aaf3379409a74fcc19d5efa9a012e70ee"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#aaf3379409a74fcc19d5efa9a012e70ee">drogon::MultiPartParser::~MultiPartParser</a></div><div class="ttdeci">~MultiPartParser()</div><div class="ttdef"><b>Definition</b> MultiPart.h:128</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_ab2fec74184787d58dd0c359ecfbf63d8"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#ab2fec74184787d58dd0c359ecfbf63d8">drogon::MultiPartParser::parse</a></div><div class="ttdeci">int parse(const HttpRequestPtr &amp;req)</div><div class="ttdoc">Parse the http request stream to get files and parameters.</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_ab711507f4a50f4b5092a6820d51d6c76"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#ab711507f4a50f4b5092a6820d51d6c76">drogon::MultiPartParser::getParameters</a></div><div class="ttdeci">const SafeStringMap&lt; std::string &gt; &amp; getParameters() const</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_ad7a2ea2850e1b43b92cfed2fc0ec0844"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#ad7a2ea2850e1b43b92cfed2fc0ec0844">drogon::MultiPartParser::getOptionalParameter</a></div><div class="ttdeci">std::optional&lt; T &gt; getOptionalParameter(const std::string &amp;key)</div><div class="ttdef"><b>Definition</b> MultiPart.h:143</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_adf60955fac0b2816fc04d9c414fc473d"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#adf60955fac0b2816fc04d9c414fc473d">drogon::MultiPartParser::getFilesMap</a></div><div class="ttdeci">std::unordered_map&lt; std::string, HttpFile &gt; getFilesMap() const</div><div class="ttdoc">Get files in a map, the keys of the map are item names of the files.</div></div>
<div class="ttc" id="aclassdrogon_1_1MultiPartParser_html_ae1386f734b22c97504319f34eab7ba20"><div class="ttname"><a href="classdrogon_1_1MultiPartParser.html#ae1386f734b22c97504319f34eab7ba20">drogon::MultiPartParser::MultiPartParser</a></div><div class="ttdeci">MultiPartParser(MultiPartParser &amp;&amp;other)=default</div></div>
<div class="ttc" id="aexports_8h_html"><div class="ttname"><a href="exports_8h.html">exports.h</a></div></div>
<div class="ttc" id="aexports_8h_html_a00d0a001c2dd03906272e00b0598182e"><div class="ttname"><a href="exports_8h.html#a00d0a001c2dd03906272e00b0598182e">DROGON_EXPORT</a></div><div class="ttdeci">#define DROGON_EXPORT</div><div class="ttdef"><b>Definition</b> exports.h:15</div></div>
<div class="ttc" id="anamespacedrogon_html"><div class="ttname"><a href="namespacedrogon.html">drogon</a></div><div class="ttdoc">Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...</div><div class="ttdef"><b>Definition</b> Attribute.h:23</div></div>
<div class="ttc" id="anamespacedrogon_html_a2037a41934aeea1598d7468b4b8cb823"><div class="ttname"><a href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">drogon::ContentType</a></div><div class="ttdeci">ContentType</div><div class="ttdef"><b>Definition</b> HttpTypes.h:100</div></div>
<div class="ttc" id="anamespacedrogon_html_a5200699555f98a809538342baa167aad"><div class="ttname"><a href="namespacedrogon.html#a5200699555f98a809538342baa167aad">drogon::HttpRequestPtr</a></div><div class="ttdeci">std::shared_ptr&lt; HttpRequest &gt; HttpRequestPtr</div><div class="ttdef"><b>Definition</b> drogon_callbacks.h:26</div></div>
<div class="ttc" id="anamespacedrogon_html_a968450214a7b7493f6f9eda71082e784"><div class="ttname"><a href="namespacedrogon.html#a968450214a7b7493f6f9eda71082e784">drogon::FileType</a></div><div class="ttdeci">FileType</div><div class="ttdef"><b>Definition</b> HttpTypes.h:179</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
